import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path:"/",
    component: () => import('../views/Login.vue')
  },{
    path: "/EmHome",
    name:"EmHome",
    component: () => import('../views/employee/Home.vue'),
    children:[{
      path:"Clock",
      component:() => import('../views/employee/Clock.vue')
    },{
      path:"EmployeeInfo",
      component:() => import('../views/employee/EmployeeInfo.vue')
    },{
      path:"Acceptability",
      component:() => import('../views/employee/Acceptability.vue')
    },{
      path:"AskLeave",
      component:() => import('../views/employee/AskLeave.vue')
    },{
      path:"ClockHistory",
      component:() => import('../views/employee/ClockHistory.vue')
    },{
      path:"AskLeaveHistory",
      component:() => import('../views/employee/AskLeaveHistory.vue')
    },{
      path:"FirstPage",
      component:() => import('../views/employee/FirstPage.vue')
    },{
      path:"ChangePassword",
      component:() => import('../views/employee/ChangePassword.vue')
    }
  ]
  },{
    path:"/AdHome",
    name:"AdHome",
    component:() => import('../views/admin/Home.vue'),
    children:[{
      path:"SetClockInfo",
      component:() => import('../views/admin/SetClockInfo.vue')
    },{
      path:"EmployeeInfo",
      component:() => import('../views/admin/EmployeeInfo.vue')
    },{
      path:"Acceptability",
      component:() => import('../views/admin/Acceptability.vue')
    },{
      path:"AskLeave",
      component:() => import('../views/admin/AskLeave.vue')
    },{
      path:"ClockHistory",
      component:() => import('../views/admin/ClockHistory.vue')
    },{
      path:"AskLeaveHistory",
      component:() => import('../views/admin/AskLeaveHistory.vue')
    },{
      path:"AdminInfo",
      component:() => import('../views/admin/AdminInfo.vue')
    },{
      path:"FirstPage",
      component:() => import('../views/admin/FirstPage.vue')
    },{
      path:"ChangePassword",
      component:() => import('../views/admin/ChangePassword.vue')
    }
  ]
  },{
    path:"/Clock",
    component:() => import('../views/employee/Clock.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})



export default router
